From: kaf24@firebug.cl.cam.ac.uk Date: Sun, 30 Apr 2006 08:52:59 +0000 (+0100) Subject: Debugging Xend with XEND_DAEMONIZE set to False doesn't work as X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16108^2~41 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=5308dc56605a799e92289bf23c769738a0a3f8f5;p=xen.git Debugging Xend with XEND_DAEMONIZE set to False doesn't work as expected. Xend actually creates two children and the XEND_DAEMONIZE flag only prevents one of the children from being created. This patch causes none of the children to be created. With this patch, Xend functionality is performed in the process executed from the command line (i.e., /usr/sbin/xend). This patch makes it possible to debug Xend with pdb. Signed-off-by: Randy Thelen --- diff --git a/tools/python/xen/xend/server/SrvDaemon.py b/tools/python/xen/xend/server/SrvDaemon.py index 866990caf8..b02d226b22 100644 --- a/tools/python/xen/xend/server/SrvDaemon.py +++ b/tools/python/xen/xend/server/SrvDaemon.py @@ -87,8 +87,6 @@ class Daemon: def daemonize(self): - if not XEND_DAEMONIZE: return - # Detach from TTY. # Become the group leader (already a child process) @@ -133,6 +131,13 @@ class Daemon: ret = 0 + # If we're not going to create a daemon, simply + # call the run method right here. + if not XEND_DAEMONIZE: + self.tracing(trace) + self.run(None) + return ret; + # we use a pipe to communicate between the parent and the child process # this way we know when the child has actually initialized itself so # we can avoid a race condition during startup